﻿@model IEnumerable<IosDatamodel.Videos>

@{
    Layout = null;
}

<!DOCTYPE html>
    <link href="@Url.Content("~/Scripts/uploadify-v3.1/uploadify.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/uploadify-v3.1/jquery.uploadify-3.1.min.js")" type="text/javascript"></script>

<html>
<head>
    <title>Index</title>
</head>
<body>
            <div id="showvideo" style="margin-top:30px"></div>
            <div id="showimage" style="margin-top:30px"></div>
    <table border="1" style="animation-play-state:inherit">

        <tr>

            <th>
                视频名称
            </th>
            <th>
               截图
            </th>
            <th>
                创建日期
            </th>
              <th>
                问题点
            </th> 
            <th>
                视频简介
            </th>


            <th colspan="2">操作</th>
        </tr>
    
    @foreach (var item in Model) {
        <tr>

            <td class="title">
                @Html.DisplayFor(modelItem => item.VideoTitle)
            </td>
            <td class="image">
                @Html.DisplayFor(modelItem => item.VideoImage)
            </td>
            <td class="datetime">
                @Html.DisplayFor(modelItem => item.DateTime)
            </td>
           <td class="issue">
                @Html.DisplayFor(modelItem => item.VideoIssue)
            </td>
            <td class="introduction">
                @Html.DisplayFor(modelItem => item.VideoIntroduction)
            </td>
            @Html.HiddenFor(modelItem => item.Id)
            <td>
@*                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.Id })*@
    <script type="text/javascript">
        var auth = "@(Request.Cookies[FormsAuthentication.FormsCookieName]==null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value)";
        var ASPSESSID = "@Session.SessionID";
        $(function () {
            $('#@item.Id').uploadify({
                'auto': false,
                'formData': { 'videoid': '@item.Id', 'ASPSESSID': ASPSESSID, 'AUTHID': auth },
                'buttonText' : '选择mp4文件',
                'swf' : '@Url.Content("~/Scripts/uploadify-v3.1/uploadify.swf")',
                'uploader': '/Videos/UploadVideo',

@*               'uploader': '@Url.Content("~/Scripts/uploadify-v3.1/uploadify.swf")',
                'script': '@Url.Action("Videos", "UploadVideo")',*@

               @* 'buttonImage': '@Url.Content("~/Scripts/uploadify-v3.1/browse-btn.png")',*@
                'fileTypeDesc': 'mp4',
                'method': 'post',
                'fileTypeExts': '*.mp4',
                'fileSizeLimit': 0,
                'fileDataName': 'file',
             //   'uploadLimit': 1,
                'onUploadComplete': function (file) {
                    $('#showvideo').html('文件 ' + file.name + ' 成功上传！');
                }
            });
        });
    </script>
上传视频：<span style="color:red"> <input style="color:red" type="file" id='@item.Id' name="file_upload" /></span>
@*<div>
    <a href="javascript:$('#file_upload').uploadify('upload');">上传</a>
</div>*@
       <span> <a href="javascript:$('#@item.Id').uploadify('upload','*');">上传</a> 
                   <a href="javascript:$('#@item.Id').uploadify('cancel', '*');">取消</a></span>

             
            </td>

            <td>

 <script type="text/javascript">
     var auth = "@(Request.Cookies[FormsAuthentication.FormsCookieName]==null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value)";
     var ASPSESSID = "@Session.SessionID";

    $(function () {
        $('#@item.Id@ViewData["shu"]').uploadify({
                    'auto': false,
                    'formData': { 'videoid': '@item.Id', 'ASPSESSID': ASPSESSID, 'AUTHID': auth },
                'buttonText': '请选择图片',
                'swf': '@Url.Content("~/Scripts/uploadify-v3.1/uploadify.swf")',
                'uploader': '/Videos/addvideoimage',
               @* 'buttonImage': '@Url.Content("~/Scripts/uploadify-v3.1/browse-btn.png")',*@
                'fileTypeDesc': '图片文件',
                'method': 'post',
                'fileTypeExts': '*.gif; *.jpg; *.png;*.gif;*.bmp;*.swf',
                'onUploadComplete': function (file) {
                    $('#showvideo').html('图片 ' + file.name + ' 成功上传！');
                }
                //'onQueueComplete': function (queueData) {
                //    $('#showimage').html(queueData.uploadsSuccessful + '个图片已经成功上传！.');
                //}
            });
            });
</script>
   上传图片:
<span style="color:red">
    <input style="color:red" type="file" id='@item.Id@ViewData["shu"]'  name="image_upload" /></span>
@*<div>
    <a href="javascript:$('#image_upload').uploadify('upload');">上传</a> 
</div>*@
    <span>
    <a href="javascript:$('#@item.Id@ViewData["shu"]').uploadify('upload','*');">上传</a> 
    <a href="javascript:$('#@item.Id@ViewData["shu"]').uploadify('cancel', '*');">取消</a>
</span>

            </td>
        </tr>
    }
    
    </table>
</body>
</html>
